﻿Imports DTO
Imports System.Data.Linq

Public Class TheHuyDao
    Public Shared Function LayBang() As Table(Of TheHuy)
        Dim db As New ThuVienDataContext()
        Return db.TheHuys
    End Function

    Public Shared Function LayDanhSach() As IEnumerable(Of TheHuy)
        Dim lst As IEnumerable(Of TheHuy)
        Dim db As New ThuVienDataContext()
        lst = From t In db.Saches Select t
        Return lst
    End Function

    Public Shared Sub Them(ByVal t As TheHuy)
        Dim db As New ThuVienDataContext()
        db.TheHuys.InsertOnSubmit(t)
        db.SubmitChanges()
    End Sub
End Class
